<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>饮食记录 - 饮食营养管理系统</title>
    <!-- TailwindCSS CDN -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- FontAwesome CDN -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
    <!-- Vue.js CDN -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body class="bg-gray-50">
    <div id="app" class="min-h-screen flex flex-col">
        <!-- 顶部导航栏 -->
        <nav class="bg-emerald-600 text-white shadow-md">
            <div class="container mx-auto px-4 py-3 flex justify-between items-center">
                <div class="flex items-center space-x-2">
                    <i class="fas fa-leaf text-2xl"></i>
                    <span class="text-xl font-bold">营养师后台管理系统</span>
                </div>
                <div class="flex items-center space-x-4">
                    <a href="#" class="hover:text-emerald-200">
                        <i class="fas fa-bell"></i>
                        <span class="bg-red-500 text-white rounded-full w-5 h-5 text-xs flex items-center justify-center absolute -mt-8 ml-3">3</span>
                    </a>
                    <div class="relative group">
                        <div class="flex items-center space-x-2 cursor-pointer">
                            <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=150&h=150&q=80" 
                                class="w-8 h-8 rounded-full object-cover" alt="用户头像">
                            <span>管理员</span>
                            <i class="fas fa-chevron-down text-xs"></i>
                        </div>
                        <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden group-hover:block">
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-user mr-2"></i>个人信息
                            </a>
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-cog mr-2"></i>系统设置
                            </a>
                            <div class="border-t border-gray-200 my-1"></div>
                            <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-emerald-100">
                                <i class="fas fa-sign-out-alt mr-2"></i>退出登录
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </nav>

        <!-- 主要内容区 -->
        <div class="flex flex-1">
            <!-- 侧边导航 -->
            <aside class="bg-white w-64 shadow-md">
                <div class="p-4">
                    <div class="relative">
                        <span class="absolute inset-y-0 left-0 flex items-center pl-3">
                            <i class="fas fa-search text-gray-400"></i>
                        </span>
                        <input type="text" class="pl-10 pr-4 py-2 w-full rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" 
                            placeholder="搜索...">
                    </div>
                </div>
                <nav class="mt-2">
                    <a href="index.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-home mr-3"></i>
                        <span>仪表盘</span>
                    </a>
                    <a href="users.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-users mr-3"></i>
                        <span>用户管理</span>
                    </a>
                    <a href="foods.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-apple-alt mr-3"></i>
                        <span>食物数据库</span>
                    </a>
                    <a href="recipes.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-utensils mr-3"></i>
                        <span>食谱管理</span>
                    </a>
                    <a href="diet-records.html" class="flex items-center px-4 py-3 text-emerald-600 bg-emerald-50 border-l-4 border-emerald-600">
                        <i class="fas fa-clipboard-list mr-3"></i>
                        <span>饮食记录</span>
                    </a>
                    <a href="nutrition.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-chart-pie mr-3"></i>
                        <span>营养分析</span>
                    </a>
                    <a href="settings.html" class="flex items-center px-4 py-3 text-gray-700 hover:bg-gray-50 hover:text-emerald-600">
                        <i class="fas fa-cog mr-3"></i>
                        <span>系统设置</span>
                    </a>
                </nav>
            </aside>

            <!-- 主内容 -->
            <main class="flex-1 p-6">
                <div class="mb-6 flex justify-between items-center">
                    <div>
                        <h1 class="text-2xl font-bold text-gray-800">饮食记录</h1>
                        <p class="text-gray-600">管理用户饮食记录、查看营养摄入数据</p>
                    </div>
                    <button class="bg-emerald-600 hover:bg-emerald-700 text-white px-4 py-2 rounded-md flex items-center">
                        <i class="fas fa-plus mr-2"></i>
                        <span>添加记录</span>
                    </button>
                </div>

                <!-- 数据卡片 -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-gray-500">今日记录总数</p>
                                <h3 class="text-3xl font-bold text-gray-800">872</h3>
                            </div>
                            <div class="bg-emerald-100 rounded-full w-12 h-12 flex items-center justify-center">
                                <i class="fas fa-clipboard-list text-emerald-600 text-xl"></i>
                            </div>
                        </div>
                        <p class="mt-4 text-red-600"><i class="fas fa-arrow-down mr-1"></i> 2.5% <span class="text-gray-500">昨日对比</span></p>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-gray-500">周记录均值</p>
                                <h3 class="text-3xl font-bold text-gray-800">905</h3>
                            </div>
                            <div class="bg-blue-100 rounded-full w-12 h-12 flex items-center justify-center">
                                <i class="fas fa-calendar-week text-blue-600 text-xl"></i>
                            </div>
                        </div>
                        <p class="mt-4 text-green-600"><i class="fas fa-arrow-up mr-1"></i> 3.1% <span class="text-gray-500">上周对比</span></p>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-gray-500">平均热量</p>
                                <h3 class="text-3xl font-bold text-gray-800">1,765</h3>
                            </div>
                            <div class="bg-purple-100 rounded-full w-12 h-12 flex items-center justify-center">
                                <i class="fas fa-fire text-purple-600 text-xl"></i>
                            </div>
                        </div>
                        <p class="mt-4 text-green-600"><i class="fas fa-arrow-up mr-1"></i> 0.8% <span class="text-gray-500">昨日对比</span></p>
                    </div>
                    
                    <div class="bg-white rounded-lg shadow-md p-6">
                        <div class="flex items-center justify-between">
                            <div>
                                <p class="text-gray-500">记录用户数</p>
                                <h3 class="text-3xl font-bold text-gray-800">624</h3>
                            </div>
                            <div class="bg-amber-100 rounded-full w-12 h-12 flex items-center justify-center">
                                <i class="fas fa-users text-amber-600 text-xl"></i>
                            </div>
                        </div>
                        <p class="mt-4 text-red-600"><i class="fas fa-arrow-down mr-1"></i> 1.2% <span class="text-gray-500">昨日对比</span></p>
                    </div>
                </div>

                <!-- 筛选和搜索 -->
                <div class="bg-white rounded-lg shadow-md p-4 mb-6">
                    <div class="flex flex-wrap gap-4">
                        <div class="relative flex-grow md:max-w-xs">
                            <span class="absolute inset-y-0 left-0 flex items-center pl-3">
                                <i class="fas fa-search text-gray-400"></i>
                            </span>
                            <input type="text" class="pl-10 pr-4 py-2 w-full rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" 
                                placeholder="搜索用户或食物...">
                        </div>
                        
                        <div class="flex items-center space-x-4 flex-wrap">
                            <div class="flex items-center space-x-2">
                                <span class="text-gray-600">日期范围:</span>
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <span>至</span>
                                <input type="date" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                            </div>
                            
                            <select class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <option value="">所有餐类型</option>
                                <option value="breakfast">早餐</option>
                                <option value="lunch">午餐</option>
                                <option value="dinner">晚餐</option>
                                <option value="snack">加餐</option>
                            </select>
                            
                            <select class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
                                <option value="">热量范围</option>
                                <option value="low">低热量 (<500kcal)</option>
                                <option value="medium">中等热量 (500-800kcal)</option>
                                <option value="high">高热量 (>800kcal)</option>
                            </select>
                        </div>
                        
                        <button class="bg-emerald-600 hover:bg-emerald-700 text-white px-4 py-2 rounded-md ml-auto">
                            筛选
                        </button>
                    </div>
                </div>

                <!-- 饮食记录表格 -->
                <div class="bg-white rounded-lg shadow-md overflow-hidden mb-6">
                    <table class="w-full text-sm text-left text-gray-700">
                        <thead class="text-gray-700 bg-gray-50">
                            <tr>
                                <th class="px-6 py-3">ID</th>
                                <th class="px-6 py-3">用户</th>
                                <th class="px-6 py-3">日期</th>
                                <th class="px-6 py-3">餐类型</th>
                                <th class="px-6 py-3">食物</th>
                                <th class="px-6 py-3">总热量</th>
                                <th class="px-6 py-3">蛋白质</th>
                                <th class="px-6 py-3">脂肪</th>
                                <th class="px-6 py-3">碳水</th>
                                <th class="px-6 py-3">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="bg-white border-b hover:bg-gray-50">
                                <td class="px-6 py-4">DR-7284</td>
                                <td class="px-6 py-4 flex items-center">
                                    <img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=50&h=50&q=80" 
                                        class="w-6 h-6 rounded-full mr-2" alt="用户头像">
                                    <span>张小明</span>
                                </td>
                                <td class="px-6 py-4">2023-09-18</td>
                                <td class="px-6 py-4">
                                    <span class="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded">早餐</span>
                                </td>
                                <td class="px-6 py-4">全麦面包, 鸡蛋, 牛奶</td>
                                <td class="px-6 py-4">450 kcal</td>
                                <td class="px-6 py-4">22g</td>
                                <td class="px-6 py-4">15g</td>
                                <td class="px-6 py-4">58g</td>
                                <td class="px-6 py-4">
                                    <div class="flex space-x-2">
                                        <button class="text-blue-600 hover:text-blue-900"><i class="fas fa-eye"></i></button>
                                        <button class="text-emerald-600 hover:text-emerald-900"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-600 hover:text-red-900"><i class="fas fa-trash-alt"></i></button>
                                    </div>
                                </td>
                            </tr>
                            <tr class="bg-white border-b hover:bg-gray-50">
                                <td class="px-6 py-4">DR-7283</td>
                                <td class="px-6 py-4 flex items-center">
                                    <img src="https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=50&h=50&q=80" 
                                        class="w-6 h-6 rounded-full mr-2" alt="用户头像">
                                    <span>李四</span>
                                </td>
                                <td class="px-6 py-4">2023-09-18</td>
                                <td class="px-6 py-4">
                                    <span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded">午餐</span>
                                </td>
                                <td class="px-6 py-4">米饭, 红烧肉, 西红柿炒蛋, 青菜</td>
                                <td class="px-6 py-4">720 kcal</td>
                                <td class="px-6 py-4">35g</td>
                                <td class="px-6 py-4">28g</td>
                                <td class="px-6 py-4">85g</td>
                                <td class="px-6 py-4">
                                    <div class="flex space-x-2">
                                        <button class="text-blue-600 hover:text-blue-900"><i class="fas fa-eye"></i></button>
                                        <button class="text-emerald-600 hover:text-emerald-900"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-600 hover:text-red-900"><i class="fas fa-trash-alt"></i></button>
                                    </div>
                                </td>
                            </tr>
                            <tr class="bg-white border-b hover:bg-gray-50">
                                <td class="px-6 py-4">DR-7282</td>
                                <td class="px-6 py-4 flex items-center">
                                    <img src="https://images.unsplash.com/photo-1580489944761-15a19d654956?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=50&h=50&q=80" 
                                        class="w-6 h-6 rounded-full mr-2" alt="用户头像">
                                    <span>王五</span>
                                </td>
                                <td class="px-6 py-4">2023-09-18</td>
                                <td class="px-6 py-4">
                                    <span class="bg-purple-100 text-purple-800 text-xs font-medium px-2.5 py-0.5 rounded">晚餐</span>
                                </td>
                                <td class="px-6 py-4">意大利面, 沙拉, 鸡胸肉</td>
                                <td class="px-6 py-4">580 kcal</td>
                                <td class="px-6 py-4">42g</td>
                                <td class="px-6 py-4">18g</td>
                                <td class="px-6 py-4">65g</td>
                                <td class="px-6 py-4">
                                    <div class="flex space-x-2">
                                        <button class="text-blue-600 hover:text-blue-900"><i class="fas fa-eye"></i></button>
                                        <button class="text-emerald-600 hover:text-emerald-900"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-600 hover:text-red-900"><i class="fas fa-trash-alt"></i></button>
                                    </div>
                                </td>
                            </tr>
                            <tr class="bg-white border-b hover:bg-gray-50">
                                <td class="px-6 py-4">DR-7281</td>
                                <td class="px-6 py-4 flex items-center">
                                    <img src="https://images.unsplash.com/photo-1607746882042-944635dfe10e?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=50&h=50&q=80" 
                                        class="w-6 h-6 rounded-full mr-2" alt="用户头像">
                                    <span>赵六</span>
                                </td>
                                <td class="px-6 py-4">2023-09-18</td>
                                <td class="px-6 py-4">
                                    <span class="bg-yellow-100 text-yellow-800 text-xs font-medium px-2.5 py-0.5 rounded">加餐</span>
                                </td>
                                <td class="px-6 py-4">酸奶, 蓝莓</td>
                                <td class="px-6 py-4">180 kcal</td>
                                <td class="px-6 py-4">8g</td>
                                <td class="px-6 py-4">3g</td>
                                <td class="px-6 py-4">29g</td>
                                <td class="px-6 py-4">
                                    <div class="flex space-x-2">
                                        <button class="text-blue-600 hover:text-blue-900"><i class="fas fa-eye"></i></button>
                                        <button class="text-emerald-600 hover:text-emerald-900"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-600 hover:text-red-900"><i class="fas fa-trash-alt"></i></button>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <!-- 分页 -->
                <div class="flex justify-between items-center">
                    <div class="text-sm text-gray-700">
                        显示 <span class="font-medium">1</span> 到 <span class="font-medium">10</span> 条，共 <span class="font-medium">134</span> 条记录
                    </div>
                    <div class="flex space-x-2">
                        <button class="px-3 py-1 rounded-md bg-white border border-gray-300 text-gray-500 hover:bg-gray-50 disabled:opacity-50">
                            上一页
                        </button>
                        <button class="px-3 py-1 rounded-md bg-emerald-600 text-white hover:bg-emerald-700">
                            1
                        </button>
                        <button class="px-3 py-1 rounded-md bg-white border border-gray-300 text-gray-700 hover:bg-gray-50">
                            2
                        </button>
                        <button class="px-3 py-1 rounded-md bg-white border border-gray-300 text-gray-700 hover:bg-gray-50">
                            3
                        </button>
                        <button class="px-3 py-1 rounded-md bg-white border border-gray-300 text-gray-500 hover:bg-gray-50">
                            下一页
                        </button>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script>
        const app = Vue.createApp({
            data() {
                return {
                    // 组件数据
                };
            },
            methods: {
                // 组件方法
            }
        });
        
        app.mount('#app');
    </script>
</body>
</html> 